home *** CD-ROM | disk | FTP | other *** search
Wrap
global gHotRects, gObjects, sQTCharSprite, gHaveNavs, gWorld, gCPU on setupG11C set shortStockObj to getaProp(gObjects, #ShortTermStock) set savedGameFlag to getaProp(shortStockObj, #savedGameFlag) startTickerTrails() if savedGameFlag = #false then initFunctionAnimatorParams() MakeDynamic(#ShortTimeIntervalParent, #State, #off) MakeDynamic(#ShortTimeIntervalDisplay, #DisplayState, #false) MakeDynamic(#ShortTimeGridDisplay, #DisplayState, #false) else if savedGameFlag = #true then if getaProp(getaProp(gObjects, #ShortStocks), #currentChildDown) <> #none then resetAnimatedGraphs() Startthetimer(1, "setupGraphAnimations") MakeDynamic(#ShortTimeIntervalParent, #State, #right) MakeDynamic(#ShortTimeIntervalDisplay, #DisplayState, 5) MakeDynamic(#ShortTimeGridDisplay, #DisplayState, 5) end if if getaProp(shortStockObj, #enteredPIN) = #valid then resetGTextFields() put string(getaProp(shortStockObj, #validPIN)) into field "G11PINDisplay.txt" set currentAccountBalance to getaProp(getaProp(gObjects, #ShortTermStock), #AccountBalance) put "$" && string(currentAccountBalance) into field "G11BalanceDisplay.txt" end if end if end if MakeDynamic(#ShortTermStock, #savedGameFlag, #true) end on setupGraphAnimations initAnimatedGraphs() clearTimePricePlotPoints() MakeDynamic(#ShortTermStock, #pricePricePreviousPoint, point(318, 314)) end on cleanupG11C set updatedCredits to integer(getaProp(getaProp(gObjects, #ShortTermStock), #AccountBalance)) setaProp(gStates, #Credits, integer(updatedCredits)) set Debt to getaProp(gStates, #Debt) if (updatedCredits - Debt) >= 15000 then MakeDynamic(#ShortTermStock, #solved, #true) setaProp(getaProp(gStates, #Conditions), #ShortStock, #true) else if getaProp(getaProp(gObjects, #PaMonitor), #HospPaid) = #false then MakeDynamic(#ShortTermStock, #solved, #false) setaProp(getaProp(gStates, #Conditions), #ShortStock, #false) end if end if set xLineXOBJ to getaProp(getaProp(gObjects, #TrendPlotter), #LineXOBj) if objectp(xLineXOBJ) then xLineXOBJ(mdispose) end if MakeDynamic(#TrendPlotter, #LineXOBj, #NULL) DelObjects([#ShortBalanceDisplay, #ShortPINDisplay]) set the trails of sprite getaProp(getaProp(gObjects, #TrendPlotter), #SpriteNum) to 0 setShortKeyBoardState(#on) MakeDynamic(#ShortTermStock, #enteredPIN, #none) MakeDynamic(#shortFeedback, #DisplayState, #INIT) MakeDynamic(#ShortTermStock, #pinEntries, 0) MakeDynamic(#ShortTermStock, #investAmount, 0) MakeDynamic(#ShortTermStock, #chaosLastY, #NULL) MakeDynamic(#ShortTermStock, #companySelected, #none) resetStockSelectionKeys() resetAmountSelectionKeys() clearTimePricePlotPoints() MakeDynamic(#ShortTermStock, #pricePricePreviousPoint, point(318, 314)) resetAnimatedGraphs() MakeDynamic(#ShortTermStock, #savedGameFlag, #false) end on resetStockSelectionKeys set keyRef to getaProp(getaProp(gObjects, #ShortStocks), #currentChildDown) if keyRef <> #none then MakeDynamic(keyRef, #DisplayState, #UP) end if MakeDynamic(#ShortStocks, #currentChildDown, #none) end on resetAmountSelectionKeys set keyRef to getaProp(getaProp(gObjects, #ShortAmounts), #currentChildDown) if keyRef <> #none then MakeDynamic(keyRef, #DisplayState, #UP) end if MakeDynamic(#ShortAmounts, #currentChildDown, #none) end on initFunctionAnimatorParams set stockList to getaProp(getaProp(gObjects, #ShortStocks), #Children) set chaosGenAList to getaProp(getaProp(gObjects, #ShortTermStock), #chaosGenA) set chaosSeedYList to getaProp(getaProp(gObjects, #ShortTermStock), #chaosSeedY) repeat with stockRef in stockList set chaosGenA to (389.0 + float(random(11))) / 100 setaProp(chaosGenAList, stockRef, chaosGenA) set chaosSeedY to float(random(1000)) / 1000 setaProp(chaosSeedYList, stockRef, chaosSeedY) end repeat MakeDynamic(#ShortTermStock, #chaosGenA, chaosGenAList) MakeDynamic(#ShortTermStock, #chaosSeedY, chaosSeedYList) end on getPINDisplayValue set pinCastNum to the number of cast "G11PINDisplay.txt" set pinDisplayValue to value(field "G11PINDisplay.txt") return pinDisplayValue end on setShortKeyBoardState inState if symbolp(inState) then MakeDynamic(#ShortKeyBoard, #State, inState) else put "bad parameter passed to setShortKeyBoardState" end if end on getShortKeyBoardState set kBoardOList to getaProp(gObjects, #ShortKeyBoard) set keyBoardState to getaProp(kBoardOList, #State) return keyBoardState end on DoStockKeyPad KeyNum set currentPIN to getPINDisplayValue() if integerp(KeyNum) then if getShortKeyBoardState() = #on then if field "G11PINDisplay.txt" = " " then put string(KeyNum) into field "G11PINDisplay.txt" else put string(KeyNum) after field "G11PINDisplay.txt" end if if the number of chars in field "G11PINDisplay.txt" = 4 then setShortKeyBoardState(#enterPIN) end if end if else if KeyNum = #return then if currentPIN = getaProp(getaProp(gObjects, #ShortTermStock), #validPIN) then doValidPIN() else put " " into field "G11PINDisplay.txt" doInValidPIN() end if end if end if end on doValidPIN MakeDynamic(#ShortTermStock, #enteredPIN, #valid) playSound("G11ent.aif", #keyframeCast) setShortKeyBoardState(#off) displayShortFeedback("G11CFeedBackDummy") MakeDynamic(#shortFeedback, #DisplayState, #NoFeedBack) MakeDynamic(#ShortTermStock, #AccountBalance, getaProp(gStates, #Credits)) set currentAccountBalance to getaProp(getaProp(gObjects, #ShortTermStock), #AccountBalance) put "$" && string(currentAccountBalance) into field "G11BalanceDisplay.txt" if currentAccountBalance < 100 then doAccountBalanceTooLow() end if end on doInValidPIN MakeDynamic(#ShortTermStock, #enteredPIN, #none) set currentPINEntries to getaProp(getaProp(gObjects, #ShortTermStock), #pinEntries) set currentPINEntries to currentPINEntries + 1 MakeDynamic(#ShortTermStock, #pinEntries, currentPINEntries) if currentPINEntries = 3 then doGEndGame() else playSound("G20failc.aif", #keyframeCast) Startthetimer(10, "displayInvalFeedback") Startthetimer(180, "displayEnterPINFeedback") setShortKeyBoardState(#on) end if end on displayInvalFeedback set thisCastNum to the number of cast "G11INVAL.PCT" displayShortFeedback(thisCastNum) end on displayEnterPINFeedback set thisCastNum to the number of cast "G11ENPIN.PCT" displayShortFeedback(thisCastNum) end on displayNoFeedback set thisCastNum to the number of cast "G11CFeedBackDummy" displayShortFeedback(thisCastNum) end on displayShortFeedback inCastNameOrNum if stringp(inCastNameOrNum) then set feedbackCastNum to the number of cast inCastNameOrNum else if integerp(inCastNameOrNum) then set feedbackCastNum to inCastNameOrNum end if end if set shortFeedBackSprite to getaProp(getaProp(gObjects, #shortFeedback), #SpriteNum) set the castNum of sprite shortFeedBackSprite to feedbackCastNum updateStage() end on doGEndGame stopsound("Gstudy.aif") genexitkf(#GDie) end on doAccountBalanceTooLow end on CountGTime inSeconds set startTicks to the timer repeat while the timer < (startTicks + (inSeconds * 60)) CursorandUpdate() if the mouseDown then exit end if end repeat end on DoInvestAmountKeyPad inAmount if getaProp(getaProp(gObjects, #shortFeedback), #DisplayState) = #SelectInvAmount then displayNoFeedback() MakeDynamic(#shortFeedback, #DisplayState, #NoFeedBack) end if MakeDynamic(#ShortTermStock, #investAmount, inAmount) end on DoCompanySelectKeyPad inCompany if getaProp(getaProp(gObjects, #ShortTermStock), #companySelected) = #none then initAnimatedGraphs() end if erasePricePriceGraph() resetPastTrendBar() clearTimePricePlotPoints() MakeDynamic(#ShortTermStock, #chaosLastY, #NULL) if getaProp(getaProp(gObjects, #shortFeedback), #DisplayState) = #SelectStock then displayNoFeedback() MakeDynamic(#shortFeedback, #DisplayState, #NoFeedBack) end if MakeDynamic(#ShortTermStock, #companySelected, inCompany) MakeDynamic(#ShortTimeIntervalParent, #State, #right) end on DoShortBuy if getaProp(getaProp(gObjects, #ShortTermStock), #enteredPIN) = #none then playSound("G11buy.aif", #keyframeCast) playSound("G11sell.aif", #keyframeCast) flashPINDisplay() else if (getaProp(getaProp(gObjects, #ShortTermStock), #enteredPIN) = #valid) and (getaProp(getaProp(gObjects, #ShortTermStock), #companySelected) = #none) then playSound("G11abort.aif", #keyframeCast) displayShortFeedback("G11SELSK.PCT") MakeDynamic(#shortFeedback, #DisplayState, #SelectStock) updateStage() else if (getaProp(getaProp(gObjects, #ShortTermStock), #enteredPIN) = #valid) and (getaProp(getaProp(gObjects, #ShortTermStock), #investAmount) = 0) then playSound("G11abort.aif", #keyframeCast) displayShortFeedback("G11SELIN.PCT") MakeDynamic(#shortFeedback, #DisplayState, #SelectInvAmount) updateStage() else handleBuy() end if end if end if end on handleBuy set AccountBalance to getaProp(getaProp(gObjects, #ShortTermStock), #AccountBalance) set stocktoBuy to getaProp(getaProp(gObjects, #ShortTermStock), #companySelected) set timeInterval to getaProp(getaProp(gObjects, #ShortTermStock), #timeInterval) set investAmount to getaProp(getaProp(gObjects, #ShortTermStock), #investAmount) set stockPrice to calcStockPrice() if stockPrice > 0 then set numSharesBought to integer(investAmount / stockPrice) else set numSharesBought to 0 end if set moneySpent to numSharesBought * stockPrice set newAccountBalance to AccountBalance - moneySpent if newAccountBalance >= 100 then MakeDynamic(#ShortTermStock, #AccountBalance, newAccountBalance) setaProp(gStates, #Credits, integer(newAccountBalance)) updatePortfolioBuy(stocktoBuy, numSharesBought) put "$" && string(newAccountBalance) into field "G11BalanceDisplay.txt" else displayShortFeedback("G11INFND.PCT") Startthetimer(30, "jumpG11A") end if end on jumpG11A Jumptokey(#G11a) end on calcStockPrice set company to getaProp(getaProp(gObjects, #ShortTermStock), #companySelected) set dataList to getaProp(getaProp(gObjects, #ShortTermStock), #timePricePlotPoints) set stockPrice to getAt(dataList, count(dataList)) return stockPrice end on updatePortfolioBuy inStock, SharesBought set portfolio to getaProp(getaProp(gObjects, #ShortTermStock), #shortPortfolio) set sharesOwned to getaProp(getaProp(portfolio, inStock), #Shares) set sharesOwned to sharesOwned + SharesBought setaProp(getaProp(portfolio, inStock), #Shares, sharesOwned) MakeDynamic(#ShortTermStock, #shortPortfolio, portfolio) end on DoShortSell if getaProp(getaProp(gObjects, #ShortTermStock), #enteredPIN) = #none then playSound("G11buy.aif", #keyframeCast) playSound("G11sell.aif", #keyframeCast) flashPINDisplay() else if (getaProp(getaProp(gObjects, #ShortTermStock), #enteredPIN) = #valid) and (getaProp(getaProp(gObjects, #ShortTermStock), #companySelected) = #none) then playSound("G11abort.aif", #keyframeCast) displayShortFeedback("G11SELSK.PCT") MakeDynamic(#shortFeedback, #DisplayState, #SelectStock) updateStage() else if (getaProp(getaProp(gObjects, #ShortTermStock), #enteredPIN) = #valid) and (getaProp(getaProp(gObjects, #ShortTermStock), #investAmount) = 0) then playSound("G11abort.aif", #keyframeCast) displayShortFeedback("G11SELIN.PCT") MakeDynamic(#shortFeedback, #DisplayState, #SelectInvAmount) updateStage() else handleSell() end if end if end if end on handleSell set AccountBalance to getaProp(getaProp(gObjects, #ShortTermStock), #AccountBalance) set stocktoSell to getaProp(getaProp(gObjects, #ShortTermStock), #companySelected) set timeInterval to getaProp(getaProp(gObjects, #ShortTermStock), #timeInterval) set numSharesSold to updatePortfolioSell(stocktoSell) set stockPrice to calcStockPrice() set moneyEarned to numSharesSold * stockPrice set newAccountBalance to AccountBalance + moneyEarned MakeDynamic(#ShortTermStock, #AccountBalance, newAccountBalance) setaProp(gStates, #Credits, integer(newAccountBalance)) put "$" && string(newAccountBalance) into field "G11BalanceDisplay.txt" end on updatePortfolioSell inStock set portfolio to getaProp(getaProp(gObjects, #ShortTermStock), #shortPortfolio) set sharesOwned to getaProp(getaProp(portfolio, inStock), #Shares) setaProp(getaProp(portfolio, inStock), #Shares, 0) MakeDynamic(#ShortTermStock, #shortPortfolio, portfolio) return sharesOwned end on flashPINDisplay global gTimerList set cycleTicks to 30 repeat with i = 0 to 3 Startthetimer((i * cycleTicks) + 15, "displayNoFeedback") Startthetimer((i * cycleTicks) + 30, "displayEnterPINFeedback") end repeat end on DoShortLogoff OBJref set OBj to getaProp(gObjects, OBJref) set overLayObj to getaProp(gObjects, #Shortreturn) set overLaySpriteNum to getaProp(overLayObj, #SpriteNum) if not voidp(getaProp(getaProp(OBj, #sound), #down)) then playSound(getaProp(getaProp(OBj, #sound), #down), #keyframeCast) end if set the castNum of sprite overLaySpriteNum to getaProp(getaProp(overLayObj, #cast), #LogOffDown) set the loc of sprite overLaySpriteNum to getaProp(overLayObj, #LogOffLoc) updateStage() repeat while the mouseDown if inside(point(the mouseH, the mouseV), getAt(getaProp(OBj, #Hotrect), 1)) then set the castNum of sprite overLaySpriteNum to getaProp(getaProp(overLayObj, #cast), #LogOffDown) set the loc of sprite overLaySpriteNum to getaProp(overLayObj, #LogOffLoc) else set the castNum of sprite overLaySpriteNum to getaProp(getaProp(overLayObj, #cast), #UP) set the loc of sprite overLaySpriteNum to getaProp(overLayObj, #loc) end if CursorandUpdate() end repeat set the castNum of sprite overLaySpriteNum to getaProp(getaProp(overLayObj, #cast), #UP) set the loc of sprite overLaySpriteNum to getaProp(overLayObj, #loc) updateStage() Jumptokey(#G11a) end on DoShortLeft set displayStates to getaProp(getaProp(gObjects, #ShortTimeIntervalParent), #allStates) set currentState to getaProp(getaProp(gObjects, #ShortTimeIntervalDisplay), #DisplayState) set currentIndex to getPos(displayStates, currentState) if currentState = 50 then setaProp(getaProp(gObjects, #ShortTimeIntervalParent), #State, #both) end if if currentState = 10 then setaProp(getaProp(gObjects, #ShortTimeIntervalParent), #State, #right) end if if currentState > 5 then set newIndex to currentIndex - 1 set newState to getAt(displayStates, newIndex) setTimeIntervalDisplays(newState) setPastTrendBar() end if end on DoShortRight set displayStates to getaProp(getaProp(gObjects, #ShortTimeIntervalParent), #allStates) set currentState to getaProp(getaProp(gObjects, #ShortTimeIntervalDisplay), #DisplayState) set currentIndex to getPos(displayStates, currentState) if currentState = 5 then setaProp(getaProp(gObjects, #ShortTimeIntervalParent), #State, #both) end if if currentState = 45 then setaProp(getaProp(gObjects, #ShortTimeIntervalParent), #State, #left) end if if currentState < 50 then set newIndex to currentIndex + 1 set newState to getAt(displayStates, newIndex) setTimeIntervalDisplays(newState) setPastTrendBar() end if end on setTimeIntervalDisplays inInterval MakeDynamic(#ShortTermStock, #timeInterval, inInterval) playSound(soundString(inInterval), #keyframeCast) set OBJ1 to getaProp(gObjects, #ShortTimeIntervalDisplay) set OBJ2 to getaProp(gObjects, #ShortTimeGridDisplay) setaProp(OBJ1, #DisplayState, inInterval) setaProp(OBJ2, #DisplayState, inInterval) displayGObj(#ShortTimeIntervalDisplay) displayGObj(#ShortTimeGridDisplay) end on soundString timeInterval if timeInterval = 5 then return "G11t05.aif" else return "G11t" & string(timeInterval) & ".aif" end if end on erasePricePriceGraph setaProp(getaProp(gObjects, #ShortTimeGridDisplay), #DisplayState, #erase) displayGObj(#ShortTimeGridDisplay) end on startTickerTrails Startthetimer(30, "Trailit") if gCPU = #mac then set xLineXOBJ to MovieUtilities(mnew) else if gCPU = #mpc then set xLineXOBJ to MovUtils(mnew) end if end if setaProp(getaProp(gObjects, #TrendPlotter), #LineXOBj, xLineXOBJ) end on Trailit set the trails of sprite getaProp(getaProp(gObjects, #TrendPlotter), #SpriteNum) to 1 end on initAnimatedGraphs set animChildrenRefList to getaProp(getaProp(gObjects, #ShortGraphs), #Children) repeat with OBJref in animChildrenRefList set newLoc to getaProp(getaProp(gObjects, OBJref), #loc2) MakeDynamic(OBJref, #loc, newLoc) set thisOBJAnim to getaProp(getaProp(gObjects, OBJref), #animator) set the pCurrentLoc of thisOBJAnim to newLoc end repeat CursorandUpdate() end on resetAnimatedGraphs set animChildrenRefList to getaProp(getaProp(gObjects, #ShortGraphs), #Children) repeat with OBJref in animChildrenRefList set newLoc to getaProp(getaProp(gObjects, OBJref), #offloc) MakeDynamic(OBJref, #loc, newLoc) end repeat end on updateTimePricePlotPoints inDataPoint set dataList to getaProp(getaProp(gObjects, #ShortTermStock), #timePricePlotPoints) set rawDataPoint to the locV of inDataPoint set normalizedDataPoint to 79 - rawDataPoint add(dataList, normalizedDataPoint) if count(dataList) = 52 then deleteAt(dataList, 1) end if setaProp(getaProp(gObjects, #ShortTermStock), #timePricePlotPoints, dataList) end on clearTimePricePlotPoints set dataList to getaProp(getaProp(gObjects, #ShortTermStock), #timePricePlotPoints) set dataList to [] MakeDynamic(#ShortTermStock, #timePricePlotPoints, dataList) end on setPastTrendBar set PastOBJAnim to getaProp(getaProp(gObjects, #PastTrendBar), #animator) set PresentOBJAnim to getaProp(getaProp(gObjects, #PresentTrendBar), #animator) set pastSpriteNum to getaProp(getaProp(gObjects, #PastTrendBar), #SpriteNum) set animationStepH to 2 set updateJumpH to 5 set barWidthOffset to the right of sprite getaProp(getaProp(gObjects, #PastTrendBar), #SpriteNum) - the left of sprite getaProp(getaProp(gObjects, #PastTrendBar), #SpriteNum) set currentState to getaProp(getaProp(gObjects, #ShortTimeIntervalDisplay), #DisplayState) set pixelOffset to currentState * getaProp(getaProp(gObjects, #ShortGraphs), #timeScale) set currentPastLoc to the pCurrentLoc of PastOBJAnim set currentPastLocH to the locH of currentPastLoc set currentPastLocV to the locV of currentPastLoc set currentPresentLoc to the pCurrentLoc of PresentOBJAnim set currentPresentLocH to the locH of currentPresentLoc if currentPresentLocH > currentPastLocH then set currentOffsetH to currentPresentLocH - currentPastLocH else set currentOffsetH to currentPresentLocH - 34 + (526 - currentPastLocH) end if set updateCycles to 2 set newOffsetH to pixelOffset + barWidthOffset if newOffsetH > currentOffsetH then set updateFlag to #moveLeft set targetPastLocH to currentPastLocH + (updateCycles * (animationStepH - updateJumpH)) repeat with i = 1 to updateCycles set currentPastLoc to the pCurrentLoc of PastOBJAnim set currentPastLocH to the locH of currentPastLoc set newPastLocH to currentPastLocH - updateJumpH if newPastLocH < 34 then set newPastLocH to 526 - (34 - newPastLocH) end if set the loc of sprite pastSpriteNum to point(newPastLocH, currentPastLocV) updateStage() end repeat else set updateFlag to #moveRight set targetPastLocH to currentPastLocH + (updateCycles * (animationStepH + updateJumpH)) repeat with i = 1 to updateCycles set currentPastLoc to the pCurrentLoc of PastOBJAnim set currentPastLocH to the locH of currentPastLoc set newPastLocH to currentPastLocH + updateJumpH if newPastLocH > 526 then set newPastLocH to 34 + newPastLocH - 526 end if set the loc of sprite pastSpriteNum to point(newPastLocH, currentPastLocV) updateStage() end repeat end if set timeInterval to getaProp(getaProp(gObjects, #ShortTermStock), #timeInterval) end on resetPastTrendBar set PastOBJAnim to getaProp(getaProp(gObjects, #PastTrendBar), #animator) set PresentOBJAnim to getaProp(getaProp(gObjects, #PresentTrendBar), #animator) set timeInterval to getaProp(getaProp(gObjects, #ShortTermStock), #timeInterval) set updateJumpH to 2 set updateCycles to 2 * timeInterval / updateJumpH set currentPastLoc to the pCurrentLoc of PastOBJAnim set currentPastLocV to the locV of currentPastLoc repeat with i = 1 to updateCycles set currentPastLoc to the loc of sprite getaProp(getaProp(gObjects, #PastTrendBar), #SpriteNum) set currentPastLocH to the locH of currentPastLoc set newPastLocH to currentPastLocH + updateJumpH if newPastLocH > 526 then set newPastLocH to 34 + newPastLocH - 526 end if set the loc of sprite getaProp(getaProp(gObjects, #PastTrendBar), #SpriteNum) to point(newPastLocH, currentPastLocV) updateStage() end repeat repeat with i = 1 to 10 / updateJumpH set currentPastLoc to the loc of sprite getaProp(getaProp(gObjects, #PastTrendBar), #SpriteNum) set currentPastLocH to the locH of currentPastLoc set newPastLocH to currentPastLocH - updateJumpH if newPastLocH < 34 then set newPastLocH to 526 - (34 - newPastLocH) end if set the loc of sprite getaProp(getaProp(gObjects, #PastTrendBar), #SpriteNum) to point(newPastLocH, currentPastLocV) updateStage() end repeat setTimeIntervalDisplays(5) end on displayGObj OBJref set OBj to getaProp(gObjects, OBJref) set the castNum of sprite getaProp(OBj, #SpriteNum) to getAt(getaProp(getaProp(OBj, #cast), getaProp(OBj, #DisplayState)), 1) set the loc of sprite getaProp(OBj, #SpriteNum) to getaProp(OBj, #loc) updateStage() end on CalFromOffsets offset, RefName set V to the locV of offset set H to the locH of offset set cur to getaProp(gObjects, RefName) setaProp(cur, #loc, getaProp(cur, #loc) + offset) setAt(getaProp(cur, #Hotrect), 1, getAt(getaProp(cur, #Hotrect), 1) + rect(H, V, H, V)) end on ToggleDNCOND OBJref set OBj to getaProp(gObjects, OBJref) if getaProp(getaProp(gObjects, getaProp(OBj, #Parent)), #State) = getaProp(OBj, #parentState) then if not voidp(getaProp(getaProp(OBj, #sound), #down)) then playSound(getaProp(getaProp(OBj, #sound), #down), #keyframeCast) end if set the castNum of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(OBj, #cast), #down) MakeDynamic(OBJref, #DisplayState, #down) set lastButtonDown to getaProp(getaProp(gObjects, getaProp(OBj, #Parent)), #currentChildDown) set lastObjDown to getaProp(gObjects, lastButtonDown) MakeDynamic(getaProp(getaProp(gObjects, getaProp(OBj, #Parent)), #RefName), #currentChildDown, getaProp(OBj, #RefName)) if (lastButtonDown <> #none) and (lastButtonDown <> getaProp(OBj, #RefName)) then set the castNum of sprite getaProp(lastObjDown, #SpriteNum) to getaProp(getaProp(lastObjDown, #cast), #UP) MakeDynamic(lastButtonDown, #DisplayState, #UP) updateStage() end if if not voidp(getaProp(getaProp(OBj, #Action), #UP)) then do(getaProp(getaProp(OBj, #Action), #UP)) end if end if end on ButtonDNDUALCOND OBJref set OBj to getaProp(gObjects, OBJref) set onStates to getaProp(OBj, #parentState) if (getaProp(getaProp(gObjects, getaProp(OBj, #Parent)), #State) = getAt(onStates, 1)) or (getaProp(getaProp(gObjects, getaProp(OBj, #Parent)), #State) = getAt(onStates, 2)) then if not voidp(getaProp(getaProp(OBj, #sound), #down)) then playSound(getaProp(getaProp(OBj, #sound), #down), #keyframeCast) end if set the castNum of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(OBj, #cast), #down) updateStage() repeat while the mouseDown if inside(point(the mouseH, the mouseV), getAt(getaProp(OBj, #Hotrect), 1)) then set the castNum of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(OBj, #cast), #down) else set the castNum of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(OBj, #cast), #UP) end if CursorandUpdate() end repeat if not voidp(getaProp(getaProp(OBj, #sound), #UP)) then playSound(getaProp(getaProp(OBj, #sound), #UP), #keyframeCast) end if do(getaProp(getaProp(OBj, #Action), #UP)) set the castNum of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(OBj, #cast), #UP) updateStage() end if end on jk1 Jumptokey(#G11a) end on jk2 Jumptokey(#G11D) end